package com.app.controller;

import java.io.Serializable;
import java.util.ArrayList;

import com.app.model.Movie;

@SuppressWarnings("javadoc")
public class MovieList implements Serializable{
	
	private ArrayList<Movie> movies;
	

	public MovieList(){
		this.movies = new ArrayList<Movie>();
	}
	
	//setter methods
	public ArrayList<Movie> getList(){return this.movies;}
	
	//getter methods
	public void setList(ArrayList<Movie> initList){this.movies = initList;}
	
	public void addMovie(Movie initMovie){
		this.movies.add(initMovie);
	}

	public void deleteMovie(String initName, String initDate){
		for(int i = 0; i < this.movies.size(); i++){
			if(this.movies.get(i).getTitle().equals(initName) && this.movies.get(i).getReleaseDate().equals(initDate))
				this.movies.remove(i);
		}
	}

	public void sort(){
		
	}
}
